package com.gmail.blackdog1987.carcare.util;

import java.util.Date;


/**
 * 
 * @author 董国超
 *
 */
public class StringFormater {
	public static final String FORMATPATTERN = "yyyy-MM-dd HH:mm:ss";
	/**
	 * yyyy-MM-dd HH:mm:ss
	 * @param date
	 * @return
	 */
	public static String format(Date date){
		if(date==null){
			date = new Date(1);
		}
		return new java.text.SimpleDateFormat(FORMATPATTERN).format(date);
	}
	
	public static String formatDay(Date date){
		if(date==null){
			date = new Date(1);
		}
		return new java.text.SimpleDateFormat("yyyy-MM-dd").format(date);
	}
}
